]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Initialize properties in _init()
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 13 Jun 2017 02:24:12 +0000 (04:24 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 13 Jul 2017 15:23:54 +0000 (17:23 +0200)
While we've always considered it good style to initialize JS properties,
some code that relies on uninitialized properties having an implicit
value of 'undefined' has slipped in over time. The updated SpiderMonkey
version used by gjs now warns when accessing those properties, so we
should make sure that they are properly initialized to avoid log spam,
even though all warnings addressed here occur in conditionals that
produce the correct result with 'undefined'.

https://bugzilla.gnome.org/show_bug.cgi?id=781471

js/gdm/util.js
js/ui/appDisplay.js
js/ui/lookingGlass.js
js/ui/messageList.js
js/ui/remoteSearch.js
js/ui/status/network.js
js/ui/workspace.js

index 83ad42234d481acabc6bfeb643ab628290e67cb1..667bbf14a843d08baa42cd874233c2e2d73ecc74 100644 (file)
@@ -128,6 +128,9 @@ const ShellUserVerifier = new Lang.Class({
 
         this._client = client;
 
+        this._defaultService = null;
+        this._preemptingService = null;
+
         this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
         this._settings.connect('changed',
                                Lang.bind(this, this._updateDefaultService));
@@ -140,6 +143,7 @@ const ShellUserVerifier = new Lang.Class({
         // at startup should result in immediately initiating authentication.
         // This is different than fingerprint readers, where we only check them
         // after a user has been picked.
+        this.smartcardDetected = false;
         this._checkForSmartcard();
 
         this._smartcardInsertedId = this._smartcardManager.connect('smartcard-inserted',
index c9541b479513cc6d2b2b2e588dbe152237bdd722..b3970aef82e41c4de9e3923311bf9c4542a8596e 100644 (file)
@@ -1090,6 +1090,8 @@ const AppSearchProvider = new Lang.Class({
     _init: function() {
         this._appSys = Shell.AppSystem.get_default();
         this.id = 'applications';
+        this.isRemoteProvider = false;
+        this.canLaunchSearch = false;
     },
 
     getResultMetas: function(apps, callback) {
@@ -1258,6 +1260,7 @@ const FolderIcon = new Lang.Class({
 
     _init: function(id, path, parentView) {
         this.id = id;
+        this.name = '';
         this._parentView = parentView;
 
         this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
index bb06c1bcd285934155e6e5c0ffc4a74be17b355d..ad33290bfe482c9fdbb52d0b025cb85fd7a3a8a7 100644 (file)
@@ -783,6 +783,7 @@ const LookingGlass = new Lang.Class({
 
         this._open = false;
 
+        this._it = null;
         this._offset = 0;
         this._results = [];
 
index 8175711ba40c061319c26c042859c668f952258f..99fd09fd9ea30bb7d1ad7c71c6b8b30344989a5c 100644 (file)
@@ -165,6 +165,11 @@ const ScaleLayout = new Lang.Class({
     Name: 'ScaleLayout',
     Extends: Clutter.BinLayout,
 
+    _init: function(params) {
+        this._container = null;
+        this.parent(params);
+    },
+
     _connectContainer: function(container) {
         if (this._container == container)
             return;
@@ -299,6 +304,8 @@ const Message = new Lang.Class({
     _init: function(title, body) {
         this.expanded = false;
 
+        this._useBodyMarkup = false;
+
         this.actor = new St.Button({ style_class: 'message',
                                      accessible_role: Atk.Role.NOTIFICATION,
                                      can_focus: true,
index 4f376bc31c38ba0526c0e3c0b2cd74308fdc7a96..dab2ad1d8780b198882330c8e951574aaac2ee4e 100644 (file)
@@ -200,6 +200,7 @@ const RemoteSearchProvider = new Lang.Class({
         this.appInfo = appInfo;
         this.id = appInfo.get_id();
         this.isRemoteProvider = true;
+        this.canLaunchSearch = false;
     },
 
     createIcon: function(size, meta) {
index e86e89fab15d19caefdf2819dd71a0a8925de1dd..19c689b0cd6e935e506e526b9811c2891f29182c 100644 (file)
@@ -1709,6 +1709,7 @@ const NMApplet = new Lang.Class({
 
         this._mainConnection = null;
         this._mainConnectionIconChangedId = 0;
+        this._mainConnectionStateChangedId = 0;
 
         this._notification = null;
 
index bcde53d3f2e4f095672c05c9dd3f408060fceeda..630e2f6746d1acdc1646788d27a9390e840e6794 100644 (file)
@@ -1100,6 +1100,7 @@ const Workspace = new Lang.Class({
     _init : function(metaWorkspace, monitorIndex) {
         // When dragging a window, we use this slot for reserve space.
         this._reservedSlot = null;
+        this._reservedSlotWindow = null;
         this.metaWorkspace = metaWorkspace;
 
         // The full geometry is the geometry we should try and position